import { themes as prismThemes } from "prism-react-renderer";
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";
import { taobao } from "./config";

const config: Config = {
  title: "青蛙记-我的店铺收银系统",
  tagline: "离线单机 永久使用",
  favicon: "img/favicon.ico",

  // Set the production url of your site here
  url: "https://wodedianpu.cc",
  // Set the /<baseUrl>/ pathname under which your site is served
  // For GitHub pages deployment, it is often '/<projectName>/'
  baseUrl: "/",

  // GitHub pages deployment config.
  // If you aren't using GitHub pages, you don't need these.
  organizationName: "facebook", // Usually your GitHub org/user name.
  projectName: "docusaurus", // Usually your repo name.

  onBrokenLinks: "throw",
  onBrokenMarkdownLinks: "warn",

  // Even if you don't use internationalization, you can use this field to set
  // useful metadata like html lang. For example, if your site is Chinese, you
  // may want to replace "en" with "zh-Hans".
  i18n: {
    defaultLocale: "zh-Hans",
    locales: ["zh-Hans"],
  },

  scripts: [
    {
      src: "https://umami.lhyhq.cn/umami.js",
      async: true,
      defer: true,
      "data-website-id": "efee735a-1941-474a-b078-cced75b12162",
    },
  ],
  presets: [
    [
      "classic",
      {
        docs: {
          sidebarPath: "./sidebars.ts",
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          editUrl: "https://gitee.com/whnba/wodedianpu.cc/tree/master/",
        },
        blog: {
          showReadingTime: true,
          feedOptions: {
            type: ["rss", "atom"],
            xslt: true,
          },
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          editUrl: "https://gitee.com/whnba/wodedianpu.cc/tree/master/",
          // Useful options to enforce blogging best practices
          onInlineTags: "warn",
          onInlineAuthors: "warn",
          onUntruncatedBlogPosts: "warn",
        },

        theme: {
          customCss: "./src/css/custom.css",
        },
      } satisfies Preset.Options,
    ],
  ],

  themeConfig: {
    // Replace with your project's social card
    image: "img/docusaurus-social-card.jpg",
    navbar: {
      title: "青蛙记-我的店铺收银系统",
      logo: {
        alt: "我的店铺收银系统",
        src: "img/logo.svg",
      },
      items: [
        {
          type: "docSidebar",
          sidebarId: "tutorialSidebar",
          position: "left",
          label: "帮助文档",
        },
        { to: "/blog", label: "更新日志", position: "left" },

        {
          href: taobao,
          label: "淘宝店铺",
          position: "right",
        },
      ],
    },
    footer: {
      style: "dark",
      copyright: `<p>Copyright © ${new Date().getFullYear()} 青蛙记-我的店铺收银系统, Inc. Built with Docusaurus.</p>
		<p><a href="https://beian.miit.gov.cn" rel="nofollow" target="_blank">湘ICP备14017341号-6</a></p>
	  `,
    },
    prism: {
      theme: prismThemes.github,
      darkTheme: prismThemes.dracula,
    },
  } satisfies Preset.ThemeConfig,
};

export default config;
